package com.lagou.task03;
/**
 *
 * 用户消费信息类：
 * 特征：统计通话时长、统计上网流量、每月消费金额
 *
 * */
public class ConsumptionInfo {

    //通话时长
    private int callMinute;
    //上网流量
    private double flowG;
    //消费金额
    private double consumptionAmount;

    public int getCallMinute() {
        return callMinute;
    }

    public void setCallMinute(int callMinute) {
        if (callMinute < 0){
            System.out.println("数值不合理");
        }else {
            this.callMinute += callMinute;
        }
    }

    public double getFlowG() {
        return flowG;
    }

    public void setFlowG(double flowG) {
        if (flowG < 0){
            System.out.println("数值不合理");
        }else {
            this.flowG += flowG;
        }
    }

    public double getConsumptionAmount() {
        return consumptionAmount;
    }

    public void setConsumptionAmount(double consumptionAmount) {
        if (consumptionAmount < 0){
            System.out.println("数值不合理");
        }else {
            this.consumptionAmount += consumptionAmount;
        }
    }

    public void show(){
        System.out.println("该用户目前消费情况：");
        System.out.println("金额：" + getConsumptionAmount() + "元");
        System.out.println("通话：" + getCallMinute() + "分钟");
        System.out.println("流量：" + getFlowG() + "G");
    }
}
